Photosynthesis is the process by which plants produce glucose, which can then be respired by the plant cells, from carbon dioxide and water. Oxygen is also produced as a waste product of photosynthesis, and escapes from the stomata of the leaves. The glucose may be converted into starch if the plant needs to store surplus energy for long periods.